package com.gwnet.cabinet.enums;

/**
 * 使用类型枚举类
 * @author: WangLiang
 * @date: 2024/7/23 16:18
 */
public enum UseTypeEnum {
    PUT(1,"存"),
    GET(2,"取"),
    OPERATION(3,"维护");


    private Integer code;
    private String desc;

    UseTypeEnum(Integer code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public Integer code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    public static UseTypeEnum instance(Integer value) {
        UseTypeEnum[] enums = values();
        for (UseTypeEnum statusEnum : enums) {
            if (statusEnum.code().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
